<?php 
	require_once("../../../oh.framework/oh.framework.php"); 
		
	oh("dragarea")->open_page();	

	echo oh("css")->embed("style.css");	
	
	if (oh("simpleform")->onsubmit("parolaform")) {
		oh("redirect")->to("?parola=".oh("simpleform.parolaform.parola"));
	}
	oh("simpleform")
		->open("parolaform")
		->text("parola")
		->submit("Genera")
		->close()
	;

	oh("dragarea")->open_area("100%","500px");

	$parola = isset($_GET['parola'])&&($_GET['parola']) ? $_GET['parola'] : "Benvenuti";
	for($i=0;$i<strlen($parola);$i++) {
		$c = trim($parola{$i});
		if ($c) {
			echo '<span>'.$c.'</span>';
		} else {
			echo ' ';
		}		
	}
	
	oh("dragarea")->close_area();
	oh("dragarea")->close_page();	
?>

